package com.myzl.coal.client.config;

import com.myzl.common.config.ImageRecognitionConfig;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @ClassName PictureConfiguration
 * @Author wzb
 * @Date 2023/6/8 10:03
 * @Description
 */

@Configuration
@Slf4j
@Data
public class PictureConfiguration implements WebMvcConfigurer {

    private final ImageRecognitionConfig imageRecognitionConfig;

    @Override
    public void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/image/**")
                .addResourceLocations("file:"+imageRecognitionConfig.getImage_path());
    }
}


